<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <table border="1">
        <tr>
            <td>照片：</td> <td> <img src="person.url" width="100"> </td>
        </tr>
        <tr>
            <td>名字：</td> <td>{{person.name}}</td>
        </tr>
        <tr>
            <td>年龄：</td> <td>{{person.age}}</td>
        </tr>
        <tr>
            <td>好友：</td>
            <td>
                <ul>
<!--                    遍历数组，想让谁一直自动添加就在谁里面写循环-->
                    <li v-for="name in person.friends">{{name}}</li>
                </ul>
            </td>
        </tr>

    </table>
    <input type="button" value="加载数据" @click="f()">
</div>

<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el:"body>div",
        data:{
            person:{
                name:"",age:"",url:"",friends:[]
            }
        },

        methods:{
            f(){
                v.person = {name:"苍老师",url:"../day05/a.jpg",age:30,
                    friends:["貂蝉","西施","武则天"]};
            }
        }

    })
</script>
</body>
</html>